package de.unimannheim.ki.servlets;

import java.util.List;

import com.google.gson.Gson;

import de.unimannheim.ki.databaseentities.JSONSong;
	
public class JsonAnswer {
	private int numberOfSongs;
	
	public static Gson gson = new Gson();
	
	private int statusCode;
	
	private List<JSONSong> resultset;
	
	private JsonError error;
	

	public JsonAnswer(int statusCode, List<JSONSong> resultset, JsonError error, int numberOfSongs) {
		super();
		this.statusCode = statusCode;
		this.resultset = resultset;
		this.error = error;
		this.numberOfSongs = numberOfSongs;
	}
	 
	public String getJsonString(){
		return gson.toJson(this);
	}
	public int getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(int statusCode) {
		this.statusCode = statusCode;
	}

	public List<JSONSong> getResultset() {
		return resultset;
	}

	public void setResultset(List<JSONSong> resultset) {
		this.resultset = resultset;
	}

	public JsonError getError() {
		return error;
	}

	public void setError(JsonError error) {
		this.error = error;
	}
	
	public String toString(){
		return gson.toJson(this);
	}

	public int getNumberOfSongs() {
		return numberOfSongs;
	}

	public void setNumberOfSongs(int numberOfSongs) {
		this.numberOfSongs = numberOfSongs;
	}
}
